<?php
namespace Admin\Controller;
use Think\Controller;
use Admin\Controller\CommonController;

class CommentController extends CommonController {

    public function index(){
        if(IS_POST){
            $comment['value']=I('post.comment');
            $saveresult=M('system_config')->where(array('config'=>'comment'))->save($comment);

        }
        $sysconfig=M('system_config')->getByConfig('comment');
        $this->assign('comment',$sysconfig['value']);
        $this->display();
        if(isset($saveresult) &&  $saveresult){
            echo ('<script>$("#infostext").find("strong").html("已经成功设置！").end().addClass("in");setTimeout(function(){$("#infostext").removeClass("in").find("strong").empty;},2000);</script>');
        }
    }

}